package vessels 
{
	import constants.Colors;
	import constants.utils;
	import points.CollidePoint;
	
	/**
	 * ...
	 * @author parasitic
	 */
	public class DrawVessel extends CollidePoint 
	{

		override protected function setRadius(n:Number):void
		{
			var A:Number = utils.getDistance(0, 0, n, 0);
			var B:Number = utils.getDistance(n, 0, n / 2, n);
			var C:Number = utils.getDistance(n / 2, n, 0, 0);
			
			var c0:Number = A + B + C;
			var c1:Number = B + C - A;
			var c2:Number = C + A - B;
			var c3:Number = A + B - C;
			
			radius = (A * B * C) / Math.sqrt(c0 * c1 * c2 * c3);
		}
		
		public function draw(n:Number, lThick:Number, lColor:uint, fColor:uint, lAlpha:Number, fAlpha:Number):void
		{
			graphics.lineStyle(lThick, lColor, lAlpha);
			graphics.beginFill(fColor, fAlpha);
			graphics.moveTo(0, 0);
			graphics.lineTo(n, 0);
			graphics.lineTo(n/2, n);
			graphics.lineTo(0, 0);
			graphics.endFill();
		}
				
	}

}